all: gateway client

protoc:
	@echo "Generating Go files"
	cd src/protocol && protoc --go_out=. --go-grpc_out=. \
		--go-grpc_opt=paths=source_relative --go_opt=paths=source_relative *.proto

gateway: protoc
	@echo "Building agent gateway"
	mkdir -p bin
	go build -o bin/agent-gateway \
		github.com/zoujiaqing/smartbox-agent-gateway/src/agent-gateway

client: protoc
	@echo "Building agent client"
	mkdir -p bin
	go build -o bin/agent-client \
		github.com/zoujiaqing/smartbox-agent-gateway/src/agent-client

clean:
	go clean github.com/zoujiaqing/smartbox-agent-gateway/...
	rm -rf bin

.PHONY: agent-gateway agent-client protoc
